// Copyright 2009 Pigasus.
// GNU GPL v2.
// Author: John Zhang and Jordan Rupprecht.
//
// Implements the LoadCSV function which reads a CSV file into a List of Maps.
// The following implementation is based on that of the Java OpenCSV library:
//   http://opencsv.sourceforge.net/

#ifndef LOADCSV_H_
#define LOADCSV_H_

#include <string>
#include <vector>

#include "pigasus-types.h"

using namespace std;

const char kQuoteChar = '\"';
const char kSeparator = ',';

// Reads a CSV file and tries to load the CSV elements.
bool LoadCSVIntoVector(string filename, vector< vector<string> > *csv_elements);

// Reads a CSV file and returns it in a List of Maps. Each row will be a Map,
// which will be a mapping of the headers to the elements in their corresponding
// columns.
List LoadCSV(string filename);

#endif  // LOADCSV_H_
